var app = getApp(),
  that;

Page({
  data: {
    vipCardInfo: [],
    bizUserInfo: {},
    dqdj: 0,
    priType: 1,
    memberLevel: {}

  },
  last: function() {
    var a = this.data.dqdj;
    console.log(a),
      this.setData({
        dqdj: a - 1,
        memberLevel: that.data.vipCardInfo[a - 1]
      });
  },
  next: function() {
    var a = this.data.dqdj;
    console.log(a),
      this.setData({
        dqdj: a + 1,
        memberLevel: that.data.vipCardInfo[a + 1]
      });
  },
  swiperchange: function(a) {
    console.log(a), this.setData({
      dqdj: a.detail.current
    });
  },
  onLoad: function(a) {
    that = this;
    that.data.memberLevelId = app.globalData.memberLevelId
    if (wx.getStorageSync('bizUserInfo')) {
      that.setData({
        bizUserInfo: wx.getStorageSync('bizUserInfo')
      })
    }
  },
  onReady: function() {},
  onShow: function() {
    //会员等级
    that.getMember()

  },
  onHide: function() {},
  onUnload: function() {},
  onPullDownRefresh: function() {},
  onReachBottom: function() {},
  getMember() {
    app.getData({
      url: app.api.getMemberDetail(),
      ok: function(res) {
        if (res.statusCode == 200 && res.errMsg == 'request:ok') {
          if (res.data.code == 1) {
            console.log(res)
            that.setData({
              vipCardInfo: res.data.data,
              memberLevel: res.data.data[0]
            })
          }
        }
      }
    })
  }
})